<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="/3nod_web/layui/css/layui.css">
    <script src="/3nod_web/js/echarts.common.min.js"></script>
    <title>(IQC)周退货率推移图</title>
</head>
<body>
<input type="hidden" th:value="${session.suppliedMaterialsCheckWeekReportList}"
       id="suppliedMaterialsCheckWeekReportList"/>
<input type="hidden" th:value="${session.weekList}" id="weekList"/>
<h1>(IQC)周退货率推移图</h1>
<div style="height:500px;width: 1300px;" id="main"></div>
<script src="/3nod_web/layui/layui.all.js"></script>
<script>
    var myChart = echarts.init(document.getElementById('main'));
    var $ = jquery = layui.jquery;
    $.get("/3nod_web/charts/suppliedMaterialsCheckWeekReportList", function (data) {
        var weekList = data.data.weekList;
        var lotRejectRateArray = [];
        var suppliedMaterialsCheckWeekReportVoList = data.data.suppliedMaterialsCheckWeekReportVoList;
        for (var i = 0; i < suppliedMaterialsCheckWeekReportVoList.length; i++) {
            lotRejectRateArray[i] = suppliedMaterialsCheckWeekReportVoList[i].lotRejectRate;
        }
        console.log(lotRejectRateArray);
        var option = {
            xAxis: {
                data: weekList,
                name: '周'
            },
            yAxis: {
                type: 'value',
                name: '批退次率'
            },
            series: [{
                data: lotRejectRateArray,
                type: 'bar',
                itemStyle: {
                    normal: {
                        label: {
                            show: true,
                            position: 'top',
                            textStyle: {
                                color: '#800080'
                            },
                            formatter: '{c}%'
                        }
                    }
                }

            }]

        };
        myChart.setOption(option);
    });
</script>
</body>
</html>